import request from '@/utils/request';

// 订单列表
interface fetchOrderListProps {
  current?: number;
  order_no?: string;
  trade_no?: string;
  status?: number;
  include?: string;
}
export const fetchOrderList = (params: fetchOrderListProps) => {
  return request('/admin/orders', {
    method: 'GET',
    params,
  });
};

// 订单详情
export const fetchOrderDetail = (id: number) => {
  return request(`/admin/orders/${id}`, {
    method: 'GET',
    params: { include: 'orderDetails,goods' },
  });
};

// 订单发货
export const fetchOrderPost = (id: number, data: any) => {
  return request(`/admin/orders/${id}/post`, {
    method: 'PATCH',
    data,
  });
};
